<!-- 教学管理-课程安排-周课程计划 -->
<template>
  <div class="JNPF-common-layout">
    <div class="JNPF-common-layout-center">
      <el-row class="JNPF-common-search-box" :gutter="16">
        <el-form @submit.native.prevent>

          <el-col :span="6">
            <el-form-item label="学院名称">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options3"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="专业名称">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options4"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <template v-if="showAll">
            <el-col :span="6">
            <el-form-item label="授课教师">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options1"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="场地名称">
              <el-select v-model="listQuery.fcustomno" placeholder="请选择"
                :disabled="$store.getters.userInfo.manufacturer">
                <el-option
                  v-for="item in options2"
                  :key="item.value"
                  :label="item.label"
                  :value="item.value">
                </el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="6">
            <el-form-item label="课程名称">
              <el-input v-model="listQuery.fbillno" placeholder="课程名称" clearable />
            </el-form-item>
          </el-col>

        </template>

          <el-col :span="8">
            <el-form-item label="">
              <el-button type="primary" icon="el-icon-search" >查询</el-button>
              <el-button type="success" icon="el-icon-plus" @click="insert(undefined)">新增</el-button>
              <el-button type="danger" icon="el-icon-download">导出</el-button>
              <el-button type="text" icon="el-icon-arrow-down" @click="showAll = true" v-if="!showAll">展开</el-button>
              <el-button type="text" icon="el-icon-arrow-up" @click="showAll = false" v-else>收起</el-button>
            </el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <div class="JNPF-common-layout-main JNPF-flex-main">
        <JNPF-table :data="list" border v-loading="loading">
          <el-table-column prop="FBILLNO" label="所属学院" width="150"></el-table-column>
          <el-table-column prop="FBILLSTATE" label="所属专业" width="130"></el-table-column>
          <el-table-column prop="FWEEK" label="星期" width="65"></el-table-column>
          <el-table-column prop="FTIME" label="时间" width="95"></el-table-column>
          <el-table-column prop="FPOINT" label="场地名称"></el-table-column>
          <el-table-column prop="FTEACH" label="授课教师" width="95"></el-table-column>
          <el-table-column prop="FBILLNAME" label="课程名称"></el-table-column>
          <el-table-column prop="FBRAND" label="课节名称" width="85"></el-table-column>
          <!-- <el-table-column prop="FBEGTIME" label="开始时间"></el-table-column> -->
          <!-- <el-table-column prop="FENDTIME" label="结束时间"></el-table-column> -->
          
          <el-table-column fixed="left" label="操作" align="center" width="150">
            <template slot-scope="scope">
              <el-button type="text" @click="insert(scope.row.FBILLNO)" size="small" icon="el-icon-edit">
                编辑
              </el-button>
            <el-popconfirm title="确定删除当前数据吗？" @confirm="Catdelete(scope.row.FCATNO)">
                <el-button slot="reference" icon="el-icon-delete" style="color: red;margin-left: 10px;"
                  type="text">删除</el-button>
              </el-popconfirm>
            </template>
          </el-table-column>
        </JNPF-table>
        <pagination :total="total" :page.sync="listQuery.page" :limit.sync="listQuery.limit"/>
        <Form ref="Form"  :formationlist="customlist" />
      </div>
    </div>
  </div>
</template>
<script>
  import Form from "./Form.vue"
  import jnpf from "@/utils/jnpf"
  export default {
    name: 'shop',
    components: { Form },
    data() {
      return {
        showAll: false,

        //所属校区选择数据
        options1: [{
          value: 'L001',
          label: '秦始皇'
        }, {
          value: 'L002',
          label: '汉武帝'
        }, {
          value: 'L003',
          label: '唐太宗'
        }],

        //所属校区选择数据
        options2: [{
          value: 'L001',
          label: '化学楼'
        }, {
          value: 'L002',
          label: '综合实验楼'
        }],

        options3: [{
          value: 'L001',
          label: '化学与材料科学学院'
        }, {
          value: 'L002',
          label: '生命科学学院'
        }],

        options4: [{
          value: 'L001',
          label: '化学系'
        }, {
          value: 'L002',
          label: '化工与材料系'
        }, {
          value: 'L003',
          label: '分析测试中心'
        }, {
          value: 'L004',
          label: '生物科学'
        }],

        customlist:[
          {
            "FBILLNAME": "化工基础实验",
            "FBILLNO": "2024-11-25",
            "FWEEK": "周一",
            "FBRAND": "第二节",
            "FBEGTIME": "10:40",
            "FENDTIME": "11:50",
            "FTEACH": "汉武帝",
            "FBILLSTATE": "已结束",
            "FMEMO": ""
          },
        ],
        list: [
            {
            "FBILLNO": "化学与材料科学学院",
            "FBILLSTATE": "化学系",
            "FBILLNAME": "综合化学实验1",
            "FPOINT":"奉1教楼101",
            "FTIME":"09:00~11:00",
            "FWEEK": "周一",
            "FBRAND": "第一节",
            "FBEGTIME": "09:00",
            "FENDTIME": "10:30",
            "FTEACH": "秦始皇",
            "FMEMO": ""
            },{
            "FBILLNO": "化学与材料科学学院",
            "FBILLSTATE": "化学系",
            "FBILLNAME": "化工基础实验",
            "FPOINT":"奉1教楼201",
            "FTIME":"10:40~11:50",
            "FWEEK": "周一",
            "FBRAND": "第二节",
            "FBEGTIME": "10:40",
            "FENDTIME": "11:50",
            "FTEACH": "汉武帝",
            "FMEMO": ""
            },
            ,{
            "FBILLNO": "化学与材料科学学院",
            "FBILLSTATE": "化工与材料系",
            "FBILLNAME": "仪器分析实验",
            "FPOINT":"奉1教楼201",
            "FTIME":"13:30~15:00",
            "FWEEK": "周一",
            "FBRAND": "第三节",
            "FBEGTIME": "13:30",
            "FENDTIME": "15:00",
            "FTEACH": "唐太宗",
            "FMEMO": ""
            },{
            "FBILLNO": "化学与材料科学学院",
            "FBILLSTATE": "化工与材料系",
            "FBILLNAME": "综合化学实验2",
            "FPOINT":"奉1教楼101",
            "FTIME":"15:40~17:00",
            "FWEEK": "周一",
            "FBRAND": "第四节",
            "FBEGTIME": "15:40",
            "FENDTIME": "17:00",
            "FTEACH": "宋太祖",
            "FMEMO": ""
            },
        ],
        fbillcredate: [jnpf.dateFormat(new Date(), "YYYY-MM-DD"), jnpf.dateFormat(new Date(), "YYYY-MM-DD")],
        loading: false,
        total: 0,
        listQuery: {
          page: 1,
          limit: 20,
          sort: "desc",
          sidx: "",
          fbillstate: "",
          fbillno: "",
          begindate: undefined,
          enddate: undefined,
          fcustomno: ""
        },
      };
    },
    computed: {},
    methods: {
      insert(id) {
        this.$refs.Form.init(id);
      },
    },
  };
</script>